export const getAuthorStr = (
    {
        value
    }:{
        value?:string[];
    }
):string => {
    let result:string="";
    if(value && value?.length>0){
        for(let i=0;i<value?.length;i++){
            result+=value[i].toString()+'; ';
        }
        result += '等'+value.length+'人';
    }
    return result
}

export const getAuthorStr1 = (
    {
        value
    }:{
        value?:AircasHome.AuthorView[];
    }
):string => {
    let result:string="";
    if(value && value?.length>0){
        for(let i=0;i<value?.length;i++){
            // @ts-ignore
            result+=value[i].name.toString()+'; ';
        }
        result += '等'+value.length+'人';
    }
    return result
}

export const getKeywordStr = (
    {
        value
    }:{
        value?:string[];
    }
):string => {
    let result:string="";
    if(value && value?.length>0){
        for(let i=0;i<value?.length;i++){
            result+=value[i].toString()+'; ';
        }
    }
    return result
}

export function dataURLtoBlob (dataurl:string) {
    var arr:any = dataurl.split(',');
        var mime = arr[0].match(/:(.*?);/);
        var bstr = atob(arr[0]);
        var n = bstr.length;
        var u8arr = new Uint8Array(n);
    while (n--) {
        u8arr[n] = bstr.charCodeAt(n);
    }
    return new Blob([u8arr], { type: mime });
}




